{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# BikeSharing数据集的特征工程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "# _*_coding:utf-8_*_\n",
    "import sys"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 导入工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 读取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instant</th>\n",
       "      <th>dteday</th>\n",
       "      <th>season</th>\n",
       "      <th>yr</th>\n",
       "      <th>mnth</th>\n",
       "      <th>holiday</th>\n",
       "      <th>weekday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>weathersit</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>casual</th>\n",
       "      <th>registered</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>2011-01-01</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>6</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.344167</td>\n",
       "      <td>0.363625</td>\n",
       "      <td>0.805833</td>\n",
       "      <td>0.160446</td>\n",
       "      <td>331</td>\n",
       "      <td>654</td>\n",
       "      <td>985</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>2011-01-02</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.363478</td>\n",
       "      <td>0.353739</td>\n",
       "      <td>0.696087</td>\n",
       "      <td>0.248539</td>\n",
       "      <td>131</td>\n",
       "      <td>670</td>\n",
       "      <td>801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>2011-01-03</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.196364</td>\n",
       "      <td>0.189405</td>\n",
       "      <td>0.437273</td>\n",
       "      <td>0.248309</td>\n",
       "      <td>120</td>\n",
       "      <td>1229</td>\n",
       "      <td>1349</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>2011-01-04</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.200000</td>\n",
       "      <td>0.212122</td>\n",
       "      <td>0.590435</td>\n",
       "      <td>0.160296</td>\n",
       "      <td>108</td>\n",
       "      <td>1454</td>\n",
       "      <td>1562</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>2011-01-05</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0.226957</td>\n",
       "      <td>0.229270</td>\n",
       "      <td>0.436957</td>\n",
       "      <td>0.186900</td>\n",
       "      <td>82</td>\n",
       "      <td>1518</td>\n",
       "      <td>1600</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   instant      dteday  season  yr  mnth  holiday  weekday  workingday  \\\n",
       "0        1  2011-01-01       1   0     1        0        6           0   \n",
       "1        2  2011-01-02       1   0     1        0        0           0   \n",
       "2        3  2011-01-03       1   0     1        0        1           1   \n",
       "3        4  2011-01-04       1   0     1        0        2           1   \n",
       "4        5  2011-01-05       1   0     1        0        3           1   \n",
       "\n",
       "   weathersit      temp     atemp       hum  windspeed  casual  registered  \\\n",
       "0           2  0.344167  0.363625  0.805833   0.160446     331         654   \n",
       "1           2  0.363478  0.353739  0.696087   0.248539     131         670   \n",
       "2           1  0.196364  0.189405  0.437273   0.248309     120        1229   \n",
       "3           1  0.200000  0.212122  0.590435   0.160296     108        1454   \n",
       "4           1  0.226957  0.229270  0.436957   0.186900      82        1518   \n",
       "\n",
       "    cnt  \n",
       "0   985  \n",
       "1   801  \n",
       "2  1349  \n",
       "3  1562  \n",
       "4  1600  "
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(\"day.csv\")\n",
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 16 columns):\n",
      "instant       731 non-null int64\n",
      "dteday        731 non-null object\n",
      "season        731 non-null int64\n",
      "yr            731 non-null int64\n",
      "mnth          731 non-null int64\n",
      "holiday       731 non-null int64\n",
      "weekday       731 non-null int64\n",
      "workingday    731 non-null int64\n",
      "weathersit    731 non-null int64\n",
      "temp          731 non-null float64\n",
      "atemp         731 non-null float64\n",
      "hum           731 non-null float64\n",
      "windspeed     731 non-null float64\n",
      "casual        731 non-null int64\n",
      "registered    731 non-null int64\n",
      "cnt           731 non-null int64\n",
      "dtypes: float64(4), int64(11), object(1)\n",
      "memory usage: 91.5+ KB\n"
     ]
    }
   ],
   "source": [
    "df.info()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 特征工程"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1.数据分离"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "This is y: 0       985\n",
      "1       801\n",
      "2      1349\n",
      "3      1562\n",
      "4      1600\n",
      "5      1606\n",
      "6      1510\n",
      "7       959\n",
      "8       822\n",
      "9      1321\n",
      "10     1263\n",
      "11     1162\n",
      "12     1406\n",
      "13     1421\n",
      "14     1248\n",
      "15     1204\n",
      "16     1000\n",
      "17      683\n",
      "18     1650\n",
      "19     1927\n",
      "20     1543\n",
      "21      981\n",
      "22      986\n",
      "23     1416\n",
      "24     1985\n",
      "25      506\n",
      "26      431\n",
      "27     1167\n",
      "28     1098\n",
      "29     1096\n",
      "       ... \n",
      "701    4649\n",
      "702    6234\n",
      "703    6606\n",
      "704    5729\n",
      "705    5375\n",
      "706    5008\n",
      "707    5582\n",
      "708    3228\n",
      "709    5170\n",
      "710    5501\n",
      "711    5319\n",
      "712    5532\n",
      "713    5611\n",
      "714    5047\n",
      "715    3786\n",
      "716    4585\n",
      "717    5557\n",
      "718    5267\n",
      "719    4128\n",
      "720    3623\n",
      "721    1749\n",
      "722    1787\n",
      "723     920\n",
      "724    1013\n",
      "725     441\n",
      "726    2114\n",
      "727    3095\n",
      "728    1341\n",
      "729    1796\n",
      "730    2729\n",
      "Name: cnt, Length: 731, dtype: int64\n",
      "This is X:      instant      dteday  season  yr  mnth  holiday  weekday  workingday  \\\n",
      "0          1  2011-01-01       1   0     1        0        6           0   \n",
      "1          2  2011-01-02       1   0     1        0        0           0   \n",
      "2          3  2011-01-03       1   0     1        0        1           1   \n",
      "3          4  2011-01-04       1   0     1        0        2           1   \n",
      "4          5  2011-01-05       1   0     1        0        3           1   \n",
      "5          6  2011-01-06       1   0     1        0        4           1   \n",
      "6          7  2011-01-07       1   0     1        0        5           1   \n",
      "7          8  2011-01-08       1   0     1        0        6           0   \n",
      "8          9  2011-01-09       1   0     1        0        0           0   \n",
      "9         10  2011-01-10       1   0     1        0        1           1   \n",
      "10        11  2011-01-11       1   0     1        0        2           1   \n",
      "11        12  2011-01-12       1   0     1        0        3           1   \n",
      "12        13  2011-01-13       1   0     1        0        4           1   \n",
      "13        14  2011-01-14       1   0     1        0        5           1   \n",
      "14        15  2011-01-15       1   0     1        0        6           0   \n",
      "15        16  2011-01-16       1   0     1        0        0           0   \n",
      "16        17  2011-01-17       1   0     1        1        1           0   \n",
      "17        18  2011-01-18       1   0     1        0        2           1   \n",
      "18        19  2011-01-19       1   0     1        0        3           1   \n",
      "19        20  2011-01-20       1   0     1        0        4           1   \n",
      "20        21  2011-01-21       1   0     1        0        5           1   \n",
      "21        22  2011-01-22       1   0     1        0        6           0   \n",
      "22        23  2011-01-23       1   0     1        0        0           0   \n",
      "23        24  2011-01-24       1   0     1        0        1           1   \n",
      "24        25  2011-01-25       1   0     1        0        2           1   \n",
      "25        26  2011-01-26       1   0     1        0        3           1   \n",
      "26        27  2011-01-27       1   0     1        0        4           1   \n",
      "27        28  2011-01-28       1   0     1        0        5           1   \n",
      "28        29  2011-01-29       1   0     1        0        6           0   \n",
      "29        30  2011-01-30       1   0     1        0        0           0   \n",
      "..       ...         ...     ...  ..   ...      ...      ...         ...   \n",
      "701      702  2012-12-02       4   1    12        0        0           0   \n",
      "702      703  2012-12-03       4   1    12        0        1           1   \n",
      "703      704  2012-12-04       4   1    12        0        2           1   \n",
      "704      705  2012-12-05       4   1    12        0        3           1   \n",
      "705      706  2012-12-06       4   1    12        0        4           1   \n",
      "706      707  2012-12-07       4   1    12        0        5           1   \n",
      "707      708  2012-12-08       4   1    12        0        6           0   \n",
      "708      709  2012-12-09       4   1    12        0        0           0   \n",
      "709      710  2012-12-10       4   1    12        0        1           1   \n",
      "710      711  2012-12-11       4   1    12        0        2           1   \n",
      "711      712  2012-12-12       4   1    12        0        3           1   \n",
      "712      713  2012-12-13       4   1    12        0        4           1   \n",
      "713      714  2012-12-14       4   1    12        0        5           1   \n",
      "714      715  2012-12-15       4   1    12        0        6           0   \n",
      "715      716  2012-12-16       4   1    12        0        0           0   \n",
      "716      717  2012-12-17       4   1    12        0        1           1   \n",
      "717      718  2012-12-18       4   1    12        0        2           1   \n",
      "718      719  2012-12-19       4   1    12        0        3           1   \n",
      "719      720  2012-12-20       4   1    12        0        4           1   \n",
      "720      721  2012-12-21       1   1    12        0        5           1   \n",
      "721      722  2012-12-22       1   1    12        0        6           0   \n",
      "722      723  2012-12-23       1   1    12        0        0           0   \n",
      "723      724  2012-12-24       1   1    12        0        1           1   \n",
      "724      725  2012-12-25       1   1    12        1        2           0   \n",
      "725      726  2012-12-26       1   1    12        0        3           1   \n",
      "726      727  2012-12-27       1   1    12        0        4           1   \n",
      "727      728  2012-12-28       1   1    12        0        5           1   \n",
      "728      729  2012-12-29       1   1    12        0        6           0   \n",
      "729      730  2012-12-30       1   1    12        0        0           0   \n",
      "730      731  2012-12-31       1   1    12        0        1           1   \n",
      "\n",
      "     weathersit      temp     atemp       hum  windspeed  casual  registered  \n",
      "0             2  0.344167  0.363625  0.805833   0.160446     331         654  \n",
      "1             2  0.363478  0.353739  0.696087   0.248539     131         670  \n",
      "2             1  0.196364  0.189405  0.437273   0.248309     120        1229  \n",
      "3             1  0.200000  0.212122  0.590435   0.160296     108        1454  \n",
      "4             1  0.226957  0.229270  0.436957   0.186900      82        1518  \n",
      "5             1  0.204348  0.233209  0.518261   0.089565      88        1518  \n",
      "6             2  0.196522  0.208839  0.498696   0.168726     148        1362  \n",
      "7             2  0.165000  0.162254  0.535833   0.266804      68         891  \n",
      "8             1  0.138333  0.116175  0.434167   0.361950      54         768  \n",
      "9             1  0.150833  0.150888  0.482917   0.223267      41        1280  \n",
      "10            2  0.169091  0.191464  0.686364   0.122132      43        1220  \n",
      "11            1  0.172727  0.160473  0.599545   0.304627      25        1137  \n",
      "12            1  0.165000  0.150883  0.470417   0.301000      38        1368  \n",
      "13            1  0.160870  0.188413  0.537826   0.126548      54        1367  \n",
      "14            2  0.233333  0.248112  0.498750   0.157963     222        1026  \n",
      "15            1  0.231667  0.234217  0.483750   0.188433     251         953  \n",
      "16            2  0.175833  0.176771  0.537500   0.194017     117         883  \n",
      "17            2  0.216667  0.232333  0.861667   0.146775       9         674  \n",
      "18            2  0.292174  0.298422  0.741739   0.208317      78        1572  \n",
      "19            2  0.261667  0.255050  0.538333   0.195904      83        1844  \n",
      "20            1  0.177500  0.157833  0.457083   0.353242      75        1468  \n",
      "21            1  0.059130  0.079070  0.400000   0.171970      93         888  \n",
      "22            1  0.096522  0.098839  0.436522   0.246600     150         836  \n",
      "23            1  0.097391  0.117930  0.491739   0.158330      86        1330  \n",
      "24            2  0.223478  0.234526  0.616957   0.129796     186        1799  \n",
      "25            3  0.217500  0.203600  0.862500   0.293850      34         472  \n",
      "26            1  0.195000  0.219700  0.687500   0.113837      15         416  \n",
      "27            2  0.203478  0.223317  0.793043   0.123300      38        1129  \n",
      "28            1  0.196522  0.212126  0.651739   0.145365     123         975  \n",
      "29            1  0.216522  0.250322  0.722174   0.073983     140         956  \n",
      "..          ...       ...       ...       ...        ...     ...         ...  \n",
      "701           2  0.347500  0.359208  0.823333   0.124379     892        3757  \n",
      "702           1  0.452500  0.455796  0.767500   0.082721     555        5679  \n",
      "703           1  0.475833  0.469054  0.733750   0.174129     551        6055  \n",
      "704           1  0.438333  0.428012  0.485000   0.324021     331        5398  \n",
      "705           1  0.255833  0.258204  0.508750   0.174754     340        5035  \n",
      "706           2  0.320833  0.321958  0.764167   0.130600     349        4659  \n",
      "707           2  0.381667  0.389508  0.911250   0.101379    1153        4429  \n",
      "708           2  0.384167  0.390146  0.905417   0.157975     441        2787  \n",
      "709           2  0.435833  0.435575  0.925000   0.190308     329        4841  \n",
      "710           2  0.353333  0.338363  0.596667   0.296037     282        5219  \n",
      "711           2  0.297500  0.297338  0.538333   0.162937     310        5009  \n",
      "712           1  0.295833  0.294188  0.485833   0.174129     425        5107  \n",
      "713           1  0.281667  0.294192  0.642917   0.131229     429        5182  \n",
      "714           1  0.324167  0.338383  0.650417   0.106350     767        4280  \n",
      "715           2  0.362500  0.369938  0.838750   0.100742     538        3248  \n",
      "716           2  0.393333  0.401500  0.907083   0.098258     212        4373  \n",
      "717           1  0.410833  0.409708  0.666250   0.221404     433        5124  \n",
      "718           1  0.332500  0.342162  0.625417   0.184092     333        4934  \n",
      "719           2  0.330000  0.335217  0.667917   0.132463     314        3814  \n",
      "720           2  0.326667  0.301767  0.556667   0.374383     221        3402  \n",
      "721           1  0.265833  0.236113  0.441250   0.407346     205        1544  \n",
      "722           1  0.245833  0.259471  0.515417   0.133083     408        1379  \n",
      "723           2  0.231304  0.258900  0.791304   0.077230     174         746  \n",
      "724           2  0.291304  0.294465  0.734783   0.168726     440         573  \n",
      "725           3  0.243333  0.220333  0.823333   0.316546       9         432  \n",
      "726           2  0.254167  0.226642  0.652917   0.350133     247        1867  \n",
      "727           2  0.253333  0.255046  0.590000   0.155471     644        2451  \n",
      "728           2  0.253333  0.242400  0.752917   0.124383     159        1182  \n",
      "729           1  0.255833  0.231700  0.483333   0.350754     364        1432  \n",
      "730           2  0.215833  0.223487  0.577500   0.154846     439        2290  \n",
      "\n",
      "[731 rows x 15 columns]\n"
     ]
    }
   ],
   "source": [
    "#从原始数据中分离输入特征X和标签y\n",
    "y = df[\"cnt\"]\n",
    "X = df.drop(\"cnt\", axis = 1)\n",
    "#查看分离结果\n",
    "print(\"This is y:\", y)\n",
    "print(\"This is X:\", X)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.对类别型特征进行独热编码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>mnth_6</th>\n",
       "      <th>...</th>\n",
       "      <th>weathersit_1</th>\n",
       "      <th>weathersit_2</th>\n",
       "      <th>weathersit_3</th>\n",
       "      <th>weekday_0</th>\n",
       "      <th>weekday_1</th>\n",
       "      <th>weekday_2</th>\n",
       "      <th>weekday_3</th>\n",
       "      <th>weekday_4</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  mnth_4  \\\n",
       "0         1         0         0         0       1       0       0       0   \n",
       "1         1         0         0         0       1       0       0       0   \n",
       "2         1         0         0         0       1       0       0       0   \n",
       "3         1         0         0         0       1       0       0       0   \n",
       "4         1         0         0         0       1       0       0       0   \n",
       "\n",
       "   mnth_5  mnth_6    ...      weathersit_1  weathersit_2  weathersit_3  \\\n",
       "0       0       0    ...                 0             1             0   \n",
       "1       0       0    ...                 0             1             0   \n",
       "2       0       0    ...                 1             0             0   \n",
       "3       0       0    ...                 1             0             0   \n",
       "4       0       0    ...                 1             0             0   \n",
       "\n",
       "   weekday_0  weekday_1  weekday_2  weekday_3  weekday_4  weekday_5  weekday_6  \n",
       "0          0          0          0          0          0          0          1  \n",
       "1          1          0          0          0          0          0          0  \n",
       "2          0          1          0          0          0          0          0  \n",
       "3          0          0          1          0          0          0          0  \n",
       "4          0          0          0          1          0          0          0  \n",
       "\n",
       "[5 rows x 26 columns]"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "categorical_features = [\"season\", \"mnth\", \"weathersit\", \"weekday\"]\n",
    "\n",
    "#数据类型变为object， 才能被get_dummies处理\n",
    "for col in categorical_features:\n",
    "    df[col] = df[col].astype('object')\n",
    "X_cat = df[categorical_features]\n",
    "X_cat = pd.get_dummies(X_cat)\n",
    "X_cat.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 3.数值型特征预处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>cnt</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0.110792</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0.089623</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0.152669</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0.177174</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0.181546</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       temp     atemp       hum  windspeed       cnt\n",
       "0  0.355170  0.373517  0.828620   0.284606  0.110792\n",
       "1  0.379232  0.360541  0.715771   0.466215  0.089623\n",
       "2  0.171000  0.144830  0.449638   0.465740  0.152669\n",
       "3  0.175530  0.174649  0.607131   0.284297  0.177174\n",
       "4  0.209120  0.197158  0.449313   0.339143  0.181546"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "from sklearn.preprocessing import MinMaxScaler\n",
    "mm_X = MinMaxScaler()\n",
    "numerical_features = [\"temp\", \"atemp\", \"hum\", \"windspeed\", \"cnt\"]\n",
    "num = mm_X.fit_transform(df[numerical_features])\n",
    "X_num = pd.DataFrame(data = num, columns = numerical_features, index = df.index)\n",
    "X_num.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>mnth_6</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_4</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>cnt</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0.110792</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0.089623</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0.152669</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0.177174</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0.181546</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 33 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  mnth_4  \\\n",
       "0         1         0         0         0       1       0       0       0   \n",
       "1         1         0         0         0       1       0       0       0   \n",
       "2         1         0         0         0       1       0       0       0   \n",
       "3         1         0         0         0       1       0       0       0   \n",
       "4         1         0         0         0       1       0       0       0   \n",
       "\n",
       "   mnth_5  mnth_6     ...      weekday_4  weekday_5  weekday_6      temp  \\\n",
       "0       0       0     ...              0          0          1  0.355170   \n",
       "1       0       0     ...              0          0          0  0.379232   \n",
       "2       0       0     ...              0          0          0  0.171000   \n",
       "3       0       0     ...              0          0          0  0.175530   \n",
       "4       0       0     ...              0          0          0  0.209120   \n",
       "\n",
       "      atemp       hum  windspeed       cnt  holiday  workingday  \n",
       "0  0.373517  0.828620   0.284606  0.110792        0           0  \n",
       "1  0.360541  0.715771   0.466215  0.089623        0           0  \n",
       "2  0.144830  0.449638   0.465740  0.152669        0           1  \n",
       "3  0.174649  0.607131   0.284297  0.177174        0           1  \n",
       "4  0.197158  0.449313   0.339143  0.181546        0           1  \n",
       "\n",
       "[5 rows x 33 columns]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#组合处理后的特征数据\n",
    "X_df = pd.concat([X_cat, X_num, df[\"holiday\"], df[\"workingday\"]], axis = 1, ignore_index = False)\n",
    "X_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>instant</th>\n",
       "      <th>season_1</th>\n",
       "      <th>season_2</th>\n",
       "      <th>season_3</th>\n",
       "      <th>season_4</th>\n",
       "      <th>mnth_1</th>\n",
       "      <th>mnth_2</th>\n",
       "      <th>mnth_3</th>\n",
       "      <th>mnth_4</th>\n",
       "      <th>mnth_5</th>\n",
       "      <th>...</th>\n",
       "      <th>weekday_5</th>\n",
       "      <th>weekday_6</th>\n",
       "      <th>temp</th>\n",
       "      <th>atemp</th>\n",
       "      <th>hum</th>\n",
       "      <th>windspeed</th>\n",
       "      <th>cnt</th>\n",
       "      <th>holiday</th>\n",
       "      <th>workingday</th>\n",
       "      <th>yr</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.355170</td>\n",
       "      <td>0.373517</td>\n",
       "      <td>0.828620</td>\n",
       "      <td>0.284606</td>\n",
       "      <td>0.110792</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.379232</td>\n",
       "      <td>0.360541</td>\n",
       "      <td>0.715771</td>\n",
       "      <td>0.466215</td>\n",
       "      <td>0.089623</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.171000</td>\n",
       "      <td>0.144830</td>\n",
       "      <td>0.449638</td>\n",
       "      <td>0.465740</td>\n",
       "      <td>0.152669</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.175530</td>\n",
       "      <td>0.174649</td>\n",
       "      <td>0.607131</td>\n",
       "      <td>0.284297</td>\n",
       "      <td>0.177174</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>...</td>\n",
       "      <td>0</td>\n",
       "      <td>0</td>\n",
       "      <td>0.209120</td>\n",
       "      <td>0.197158</td>\n",
       "      <td>0.449313</td>\n",
       "      <td>0.339143</td>\n",
       "      <td>0.181546</td>\n",
       "      <td>0</td>\n",
       "      <td>1</td>\n",
       "      <td>0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 35 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   instant  season_1  season_2  season_3  season_4  mnth_1  mnth_2  mnth_3  \\\n",
       "0        1         1         0         0         0       1       0       0   \n",
       "1        2         1         0         0         0       1       0       0   \n",
       "2        3         1         0         0         0       1       0       0   \n",
       "3        4         1         0         0         0       1       0       0   \n",
       "4        5         1         0         0         0       1       0       0   \n",
       "\n",
       "   mnth_4  mnth_5 ...  weekday_5  weekday_6      temp     atemp       hum  \\\n",
       "0       0       0 ...          0          1  0.355170  0.373517  0.828620   \n",
       "1       0       0 ...          0          0  0.379232  0.360541  0.715771   \n",
       "2       0       0 ...          0          0  0.171000  0.144830  0.449638   \n",
       "3       0       0 ...          0          0  0.175530  0.174649  0.607131   \n",
       "4       0       0 ...          0          0  0.209120  0.197158  0.449313   \n",
       "\n",
       "   windspeed       cnt  holiday  workingday  yr  \n",
       "0   0.284606  0.110792        0           0   0  \n",
       "1   0.466215  0.089623        0           0   0  \n",
       "2   0.465740  0.152669        0           1   0  \n",
       "3   0.284297  0.177174        0           1   0  \n",
       "4   0.339143  0.181546        0           1   0  \n",
       "\n",
       "[5 rows x 35 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#组合所有特征与标签y数据\n",
    "FE_df = pd.concat([df[\"instant\"], X_df, df[\"yr\"]], axis = 1)\n",
    "FE_df.to_csv(\"FE_df.csv\", index = False)\n",
    "FE_df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<class 'pandas.core.frame.DataFrame'>\n",
      "RangeIndex: 731 entries, 0 to 730\n",
      "Data columns (total 35 columns):\n",
      "instant         731 non-null int64\n",
      "season_1        731 non-null uint8\n",
      "season_2        731 non-null uint8\n",
      "season_3        731 non-null uint8\n",
      "season_4        731 non-null uint8\n",
      "mnth_1          731 non-null uint8\n",
      "mnth_2          731 non-null uint8\n",
      "mnth_3          731 non-null uint8\n",
      "mnth_4          731 non-null uint8\n",
      "mnth_5          731 non-null uint8\n",
      "mnth_6          731 non-null uint8\n",
      "mnth_7          731 non-null uint8\n",
      "mnth_8          731 non-null uint8\n",
      "mnth_9          731 non-null uint8\n",
      "mnth_10         731 non-null uint8\n",
      "mnth_11         731 non-null uint8\n",
      "mnth_12         731 non-null uint8\n",
      "weathersit_1    731 non-null uint8\n",
      "weathersit_2    731 non-null uint8\n",
      "weathersit_3    731 non-null uint8\n",
      "weekday_0       731 non-null uint8\n",
      "weekday_1       731 non-null uint8\n",
      "weekday_2       731 non-null uint8\n",
      "weekday_3       731 non-null uint8\n",
      "weekday_4       731 non-null uint8\n",
      "weekday_5       731 non-null uint8\n",
      "weekday_6       731 non-null uint8\n",
      "temp            731 non-null float64\n",
      "atemp           731 non-null float64\n",
      "hum             731 non-null float64\n",
      "windspeed       731 non-null float64\n",
      "cnt             731 non-null float64\n",
      "holiday         731 non-null int64\n",
      "workingday      731 non-null int64\n",
      "yr              731 non-null int64\n",
      "dtypes: float64(5), int64(4), uint8(26)\n",
      "memory usage: 70.0 KB\n"
     ]
    }
   ],
   "source": [
    "FE_df.info()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
